while getopts ":e:p:i:u:P:h:k:D:" opt
do
    case $opt in
        f)
        force=$OPTARG
        echo "您输入的是否强制更新:$environ"
        ;;
        ?)
        echo "未知参数,你可以这样使用 : sh advcpmv.sh -f true "
        exit 1;;
    esac
done
if [[ ! -z $1 ]] && [[ -d $1 ]] && [[ -z ${unline_path} ]]
then
PREHOME=$1
elif [[ ! -z ${unline_path} ]]
then
PREHOME=${unline_path}
else
PREHOME=${HOME}"/unline"
fi
DIR=$( dirname "$(readlink -f  ${BASH_SOURCE[0]})" )
ls /usr/local/bin | grep advcp
if [[ $? -eq 1 ]] || [[ $force != "false" ]]
then
  sh ${DIR}/gitclone.sh https://github.com/jarun/advcpmv.git ${HOME}/temp/github/advcpmv
fi
cd ${HOME}/temp/github/advcpmv
sh install.sh
# sudo ln -sf /usr/local/bin/colorls /bin/ls
cat ${HOME}/.${USER}/profile | grep "unalias cp"
if [[ $? -eq 1 ]]
then
  echo "unalias cp" >> ${HOME}/.${USER}/profile
fi
cat ${HOME}/.${USER}/profile | grep -E "^alias cp"
if [[ $? -eq 1 ]]
then
  echo "alias cp='/usr/local/bin/advcp'" >> ${HOME}/.${USER}/profile
  echo "alias mv='/usr/local/bin/advmv'" >> ${HOME}/.${USER}/profile
fi

